import { http } from './request'

export const examApi = {
    // 登录接口
    login: (data) => http.post('/app/user/login', data),

    // 获取登录信息
    getProfile: () => http.get('/app/user/getInfo'),

    // 获取已考试列表
    getExamListed: (data) => http.post('/web/exam/online/papersByUser', data),

    // 获取未考试列表
    getExamList: (data) => http.post('/web/exam/online/getPaperExamLatest', data),

    // 获取考试详情
    getExamListDetail: (data) => http.post('/web/exam/online/myAppExamPaperDetail', data),

    // 开始考试
    startExam: (data) => http.post(`/web/exam/online/startAppExamPaper`, data),

    // 提交考试
    submitExam: (answers) => http.post('/web/exam/online/submitAppExamPaper', answers),

    // 获取考试结果
    getResult: (examId) => http.get(`/exams/${examId}/result`)
}